package com.newcoin.chat.service;

import com.newcoin.chat.beans.entity.FriendApplicationEntity;
import com.newcoin.chat.beans.entity.FriendMsgEntity;
import com.newcoin.chat.beans.vo.*;

import java.util.List;
import java.util.Map;

public interface FriendService {
    /**
     * 根据账号后者昵称查询好友
     *
     * @param parameter
     * @return
     * @throws Exception
     */
    ResultVo<List<UserVo>> getFriendInfoByFriendNicknameOrAccount(String parameter) throws Exception;

    /**
     * 新增添加好友申请
     *
     * @param userId
     * @param friendId
     * @return
     * @throws Exception
     */
    ResultVo<String> addFriendApplicationInfo(long userId, long friendId, String remark) throws Exception;

    /**
     * 是否有新的好友申请消息
     *
     * @param userId
     * @return
     * @throws Exception
     */
    ResultVo<Boolean> isThereANewFriendApplication(long userId) throws Exception;

    /**
     * 获取最新10条的好友申请
     *
     * @param userId
     * @return
     * @throws Exception
     */
    ResultVo<List<FriendApplicationEntity>> getFriendApplicationList(long userId) throws Exception;

    /**
     * 通过或拒绝朋友申请
     *
     * @param friendApplicationId
     * @param state
     * @return
     * @throws Exception
     */
    ResultVo<String> passOrRejectFriendApplication(long friendApplicationId, int state) throws Exception;

    /**
     * 删除好友
     *
     * @param userId
     * @param friendId
     * @return
     * @throws Exception
     */
    ResultVo<String> deleteFriend(long userId, long friendId) throws Exception;

    /**
     * 打开或关闭阅后即焚
     *
     * @param userId
     * @param friendId
     * @param state
     * @return
     * @throws Exception
     */
    ResultVo<String> openOrCloseAfterReadingIncineration(long userId, long friendId, int state) throws Exception;

    /**
     * 获取所有的好友申请信息
     *
     * @param userId
     * @param page
     * @return
     * @throws Exception
     */
    ResultVo<FriendApplicationVo> getAllFriendApplicationMessages(long userId, int page) throws Exception;

    /**
     * 通讯录列表
     *
     * @param userId
     * @return
     * @throws Exception
     */
    ResultVo<Map<String, Object>> getContactList(long userId) throws Exception;

    /**
     * 获取朋友发来的消息（离线）
     *
     * @param userId
     * @return
     * @throws Exception
     */
    ResultVo<List<FriendOfflineMsgVo>> getFriendOfflineMsg(long userId) throws Exception;

    /**
     * 获取聊天记录
     *
     * @param userId
     * @param friendId
     * @param page
     * @return
     * @throws Exception
     */
    ResultVo<List<FriendMsgEntity>> getFriendMsg(long userId, long friendId, int page) throws Exception;

    /**
     * 通过ID获取用户信息
     *
     * @param userId
     * @return
     * @throws Exception
     */
    ResultVo<UserVo> getUserInfo(Long userId) throws Exception;

    /**
     * 获取与朋友的阅后即焚状态
     *
     * @param userId
     * @param friendId
     * @return
     */
    ResultVo<Integer> getAfterReadingIncinerationState(long userId, long friendId) throws Exception;


    /**
     * 获取朋友发来的离线消息
     * @param userId
     * @param friendId
     * @return
     * @throws Exception
     */
    ResultVo<List<FriendOfflineMsgVo>> getOfflineMessage(Long userId, Long friendId) throws Exception;

}
